const path = require("path");

var url = "./text.txt";
var url2 = "./image";
var url3 = path.join(url2,url);// 拼接路径
console.log(url3);

console.log(path.resolve(url));// 将相对路径转换成绝对路径
console.log(path.extname(url));// 获取路径获取到文件的后缀
console.log(path.basename(url));// 获取路径获取到文件的文件名

console.log(_dirname);// 获取当前文件袋绝对路径